home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir31 / sndblst3.zip / RAWIN.C next >
Text File  |  1993-10-25  |  1KB  |  44 lines

  1.  
  2. //------------------------------------------------------------------------------
  3. // Copyright (c) David Welch, 1993
  4. //------------------------------------------------------------------------------
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. #include <string.h>
  8.  
  9. #include "..\sb.h"
  10. unsigned char ca;
  11. unsigned short ra;
  12. unsigned long la;
  13. FILE *fp;
  14. unsigned char gstring[80];
  15. unsigned long dLen;
  16. void main ( int argc, char *argv[] )
  17. {
  18.     if(argc<3)
  19.     {
  20.         printf("filename and/or sample rate not specified\n");
  21.         exit(1);
  22.     }
  23.     if((fp=fopen(argv[1],"wb"))==0)
  24.     {
  25.         printf("Error creating file [%s]\n",argv[1]);
  26.         exit(1);
  27.     }
  28.     printf("FILE: [%s]\n",argv[1]);
  29.     sbsetup();
  30.     ra=atoi(argv[2]);
  31.     printf("Samples Per Second %u\n",ra);
  32.     ca=256UL-(1000000UL/ra);
  33.     printf("Time Constant %u\n",ca);
  34.     sbsettc(ca);
  35.     sbrec(65000);
  36.     printf("Recording 65000 samples\n");
  37.     while(dmacount()!=0xFFFF);
  38.     fwrite(aligned,1,65000,fp);
  39. }
  40. //------------------------------------------------------------------------------
  41. // Copyright (c) David Welch, 1993
  42. //------------------------------------------------------------------------------
  43.  
  44.